package com.dxy.bean;


import java.sql.Timestamp;
import java.util.Objects;

public class User {

  private int id;
  private String username;
  private String userPhone;
  private String password;
  private String icCard;
  private Timestamp registeredTime;
  private Timestamp loginTime;
  private int status;
  private boolean user;

  public User(){}
  public User(int id, String username, String userPhone, String password, String icCard, Timestamp registeredTime, Timestamp loginTime, int status) {
    this.id = id;
    this.username = username;
    this.userPhone = userPhone;
    this.password = password;
    this.icCard = icCard;
    this.registeredTime = registeredTime;
    this.loginTime = loginTime;
    this.status = status;
  }


  public User(String username, String userPhone, String icCard, String password) {
    this.username = username;
    this.userPhone = userPhone;
    this.icCard = icCard;
    this.password = password;
  }

  public User(String userPhone, String username) {
    this.userPhone=userPhone;
    this.username = username;
  }

  public boolean isUser() {
    return user;
  }

  public void setUser(boolean user) {
    this.user = user;
  }

  public int getId() {
    return id;
  }

  public int setId(int id) {
    this.id = id;
      return id;
  }


  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }


  public String getUserPhone() {
    return userPhone;
  }

  public void setUserPhone(String userPhone) {
    this.userPhone = userPhone;
  }


  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }


  public Timestamp getRegisteredTime() {
    return registeredTime;
  }

  public void setRegisteredTime(Timestamp registeredTime) {
    this.registeredTime = registeredTime;
  }


  public Timestamp getLoginTime() {
    return loginTime;
  }

  public void setLoginTime(Timestamp loginTime) {
    this.loginTime = loginTime;
  }

  public int getStatus() {
    return status;
  }

  public void setStatus(int status) {
    this.status = status;
  }

  public String getIcCard() {
    return icCard;
  }

  public void setIcCard(String icCard) {
    this.icCard = icCard;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    User user = (User) o;
    return id == user.id && status == user.status && Objects.equals(username, user.username) && Objects.equals(userPhone, user.userPhone) && Objects.equals(password, user.password) && Objects.equals(icCard, user.icCard) && Objects.equals(registeredTime, user.registeredTime) && Objects.equals(loginTime, user.loginTime);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, username, userPhone, password, icCard, registeredTime, loginTime, status);
  }

  @Override
  public String toString() {
    return "User{" +
            "id=" + id +
            ", username='" + username + '\'' +
            ", userPhone='" + userPhone + '\'' +
            ", password='" + password + '\'' +
            ", icCard='" + icCard + '\'' +
            ", registeredTime=" + registeredTime +
            ", lastTime=" + loginTime +
            ", status=" + status +
            '}';
  }

  public static void main(String[] args) {
    System.out.println();
  }
}
